package Dao;

import java.util.Calendar;
import java.util.GregorianCalendar;

import metier.Adherent;
import metier.Exemplaire;
import exception.BiblioException;

public class AdherentsDao {

	private static Adherent[] AdherentDB= {
		new Adherent("Miredin","Arnaud",new GregorianCalendar(1984, Calendar.JANUARY, 7).getTime(),"Masculin",1,"nounou","nono","0663376080"),
		new Adherent("Miredin","Arnaud",new GregorianCalendar(1984, Calendar.JANUARY, 7).getTime(),"Masculin",1,"nounou","nono","0663376080"),
		new Adherent("Miredin","Arnaud",new GregorianCalendar(1984, Calendar.JANUARY, 7).getTime(),"Masculin",1,"nounou","nono","0663376080"),
		new Adherent("Miredin","Arnaud",new GregorianCalendar(1984, Calendar.JANUARY, 7).getTime(),"Masculin",1,"nounou","nono","0663376080"),
		new Adherent("Miredin","Arnaud",new GregorianCalendar(1984, Calendar.JANUARY, 7).getTime(),"Masculin",5,"nounou","nono","0663376080"),
		new Adherent("Miredin","Arnaud",new GregorianCalendar(1984, Calendar.JANUARY, 7).getTime(),"Masculin",6,"nounou","nono","0663376080"),
		new Adherent("Miredin","Arnaud",new GregorianCalendar(1984, Calendar.JANUARY, 7).getTime(),"Masculin",7,"nounou","nono","0663376080"),
		new Adherent("Miredin","Arnaud",new GregorianCalendar(1984, Calendar.JANUARY, 7).getTime(),"Masculin",8,"nounou","nono","0663376080"),
		new Adherent("Miredin","Arnaud",new GregorianCalendar(1984, Calendar.JANUARY, 7).getTime(),"Masculin",9,"nounou","nono","0663376080"),
		new Adherent("Miredin","Arnaud",new GregorianCalendar(1984, Calendar.JANUARY, 7).getTime(),"Masculin",10,"nounou","nono","0663376080"),
	};
	
	
	public static Adherent findByKey (int id){
		for (Adherent a  : AdherentDB){
			if (id == a.getIdAdherent()) return a;	
			}
		try {
			throw new BiblioException("utilisateur inconnu");
		} 
		catch (BiblioException e) {
			e.printStackTrace();
		}
		return null;
	}
}
